package com.bytedance.social.mapper;

import com.bytedance.social.pojo.Relation;
import com.bytedance.social.pojo.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface RelationMapper {
    public void insertRelation(Relation relation);

    public void deleteRelation(Relation relation);

    public void updateUserFollowCount(@Param("currentUserId") Long userId, @Param("followCount") Long followCount);

    public void updateUserFollowerCount(@Param("toUserId") Long toUserId, @Param("followerCount") Long followerCount);

    public Relation selectIsFollow(@Param("currentId") Long currentId, @Param("toId") Long toId);

    public List<Relation> selectFollows(@Param("userId") Long userId);

    public List<Relation> selectFollowers(@Param("toUserId") Long toUserId);
}
